<template>
	<view class="main">
		<view class="header">
			<text>新鲜事</text>
			<image @click="fabu" id="tianjia" src="../../static/icons/tianjia.png"></image>
		</view>
		<view v-for="(item,index) in arr" class="content">
			<view class="user">
				<image :src="item.avatarurl" class="touxiang"></image>
				<text class="username">{{item.username}}</text>
				<text class="date">{{item.create_time}}</text>
			</view>
			<view class="write">
				<text>{{item.title}}</text>
				<view class="images">
					<image v-for="(v,i) in arr[index].imagesList" :src="v.img_url" mode="aspectFill"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				arr: [

				],
			}
		},
		methods: {
			fabu() {
				uni.navigateTo({
					url: '../xinxianshi/fabu'
				});
			},
			//加载			
			Refresh() {
				this.$http({
					url: "/newthing/findAllNewThing",
					method: "get",
				}).then(res => {
					this.arr = res.data.data;
					console.log(this.arr);
				})
			},
			onLoad() {
				this.Refresh();
			},
		}
	}
</script>

<style lang="less" scoped>
	.main {
		margin: 30rpx;
	}

	.header {
		font-size: 46rpx;
		display: flex;
		justify-content: space-between;

	}

	#tianjia {
		width: 46rpx;
		height: 46rpx;
	}

	.content {
		margin: 30rpx 0;
		border-bottom: solid 2rpx #ebebeb;
	}

	.user {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.touxiang {
		width: 80rpx;
		height: 80rpx;
		border-radius: 50%;
		margin-right: 20rpx;
	}

	.username {
		flex: 1;
		font-size: 32rpx;
		font-weight: bolder;
	}

	.date {
		font-size: 24rpx;
		color: #717171;
	}

	.write {
		margin: 0 0 0 100rpx;
	}

	.write>text {
		color: #717171;
		margin-bottom: 20rpx;
	}

	.images {
		margin: 30rpx 0;
		display: flex;
		justify-content: space-between;
		flex-wrap: wrap;
		align-content: space-around;

	}

	.images>image {
		max-height: 190rpx;
		flex: 1;
		border-radius: 30rpx;
	}
</style>
